#!/usr/bin/env python3

"""Simple example to generate audio with preset voice using async/await"""

import asyncio
import edge_tts

TEXT = "注意看，这个男孩叫小美!"
VOICE = "zh-CN-XiaoxiaoNeural"
OUTPUT_FILE = "test.mp3"

voice_models = [
    {'Name': 'zh-CN-XiaoxiaoNeural', 'Gender': 'Female', 'Role': '晓晓（少女）'},
    # {'Name': 'zh-CN-XiaoyiNeural', 'Gender': 'Female', 'Role': '小艺（童声）'},
    # {'Name': 'zh-CN-YunjianNeural', 'Gender': 'Male', 'Role': '云间（大叔）'},
    # {'Name': 'zh-CN-YunxiNeural', 'Gender': 'Male', 'Role': '云希（最常见）'},
    # {'Name': 'zh-CN-YunxiaNeural', 'Gender': 'Male', 'Role': '云霞（童声）'},
    # {'Name': 'zh-CN-YunyangNeural', 'Gender': 'Male', 'Role': '云阳（次常见，新闻）'}
]


async def amain() -> None:
    for x in voice_models:
        communicate = edge_tts.Communicate("首先点击左侧菜单“查看公告”打开查看公告页面，然后找到对应的招聘公告点击并打开查看公告详情页面。", x['Name'])
        await communicate.save(x['Role'] + OUTPUT_FILE)


if __name__ == "__main__":
    asyncio.run(amain())
